package com.imooc.cls2;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class beanTest2 {
    @Test
    public void test(){
        ApplicationContext context=new ClassPathXmlApplicationContext("spring.xml");
        Bean bean=context.getBean("bean",Bean.class);
        System.out.println("bean="+bean);

        Bean2 bean2=Bean2Factory.getBean2();
        Bean2 bean2_1=context.getBean("bean2",Bean2.class);
        System.out.println("bean2 ="+bean2);
        System.out.println("bean2_1="+bean2_1);

        Bean3 bean3=context.getBean("bean3",Bean3.class);
        System.out.println("bean3="+bean3);

        Bean bean1=context.getBean("bean1",Bean.class);
        Bean bean1_1=context.getBean("bean1_1",Bean.class);
        System.out.println("bean1="+bean1);
        System.out.println("bean1_1="+bean1_1);
    }
}
